<div class="row" ng-controller="UserCtrl">
    <div class="col-lg-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <strong>用户列表</strong>
            </div>

            <div class="panel-body">
                <a id="add_user" role="button" class="btn btn-primary btn-sm" ng-click="addUser()">
                    <i class="glyphicon glyphicon-plus">
                    </i> 添加用户
                </a>
                <div clss="table-container">
                    <div id="outerdiv">
                        <div id="innerdiv">
                            <table st-pipe="callServer" st-table="displayed" class="table table-striped">
                                <thead>
                                <tr>
                                    <th st-ratio="10" st-sort="realname">姓名</th>
                                    <th st-ratio="10" st-sort="username">登录名</th>
                                    <th st-ratio="10" st-sort="role">角色</th>
                                    <th st-ratio="10" st-sort="email">email</th>
                                    <th st-ratio="10" st-sort="phone">联系电话</th>
                                    <th st-ratio="10" st-sort="hospital">所属医院</th>
                                    <th st-ratio="30" st-align-center>操作</th>
                                </tr>
                                <tr>
                                    <th st-ratio="15" >
                                        <input st-search="realname" placeholder="通过真实姓名查询" class="input-sm form-control" type="search"/>
                                    </th>
                                    <th st-ratio="85" colspan="5">
                                        <input st-search="username" placeholder="通过登录名查询" class="input-sm form-control" type="search"/>
                                    </th>
                                </tr>
                                </thead>
                                <tbody ng-hide="isLoading">
                                <tr ng-repeat="row in displayed">
                                    <td>{{row.realname}}</td>
                                    <td>{{row.username}}</td>
                                    <td>
                                        <div ng-switch="{{row.role}}">
                                            <div  ng-switch-when="1">
                                                管理员
                                            </div>

                                            <div  ng-switch-when="2">
                                                财务
                                            </div>

                                            <div  ng-switch-when="3">
                                                销售
                                            </div>

                                            <div ng-switch-when="4">
                                                外派人员
                                            </div>
                                        </div>
                                    </td>
                                    <td>{{row.email}}</td>
                                    <td>{{row.phone}}</td>
                                    <td>{{row.hospital.name}}</td>
                                    <td st-align-center>

                                        <button type="button" ng-click="editUser($index)" class="btn btn-sm btn-primary">
                                            <i class="glyphicon glyphicon-pencil">
                                            </i>
                                        </button>

                                        <button type="button" ng-click="removeItem($index)" class="btn btn-sm btn-danger">
                                            <i class="glyphicon glyphicon-remove-circle">
                                            </i>
                                        </button>
                                    </td>
                                </tr>
                                </tbody>
                                <tbody ng-show="isLoading">
                                <tr>
                                    <td colspan="7" class="text-center">Loading ... </td>
                                </tr>
                                <tfoot>
                                <tr>
                                    <!--<td class="text-center" st-pagination="" st-items-by-page="10" colspan="4"></td>-->
                                    <td colspan=7 class="text-center">
                                        <div st-items-by-page="10" colspan="50" st-pagination="" st-template="partials/pagination.custom.html"></div>
                                    </td>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>